package util;

import java.util.concurrent.TimeUnit;

/**
 * @Author: zhangrongqing
 * @Date: 2019/12/19 17:17
 */
public class ThreadUtil {

    public static void sleep(long  time, TimeUnit timeUnit){
        long timeSleep = timeUnit.toMillis(time);
        try {
            Thread.sleep(timeSleep);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void sleep(long  time){
        sleep(time,TimeUnit.MILLISECONDS);
    }

    public static void main(String[] args) {
        System.out.println(TimeUnit.DAYS.toMillis(1));
    }
}
